<?php
/**@package     Joomla.Site
 * @subpackage  Templates.protostar
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt*/
defined('_JEXEC') or die;
$app             = JFactory::getApplication();
$doc             = JFactory::getDocument();
$user            = JFactory::getUser();
$this->language  = $doc->language;
$this->direction = $doc->direction;
// Getting params from template
$params = $app->getTemplate(true)->params;
// Detecting Active Variables
$option   = $app->input->getCmd('option', '');
$view     = $app->input->getCmd('view', '');
$layout   = $app->input->getCmd('layout', '');
$task     = $app->input->getCmd('task', '');
$itemid   = $app->input->getCmd('Itemid', '');
$sitename = $app->get('sitename');
if($task == "edit" || $layout == "form" ){$fullWidth = 1;}
else{$fullWidth = 0;}
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
$doc->addScript('templates/' . $this->template . '/js/template.js');
// Add Stylesheets
$doc->addStyleSheet('templates/' . $this->template . '/css/template.css');
// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);
// Adjusting content width
if ($this->countModules('position-7') && $this->countModules('position-8')){$span = "span6";}
elseif ($this->countModules('position-7') && !$this->countModules('position-8')){$span = "span9";}
elseif (!$this->countModules('position-7') && $this->countModules('position-8')){$span = "span9";}
else{$span = "span12";}
// Logo file or site title param
if ($this->params->get('logoFile')){
	$logo = '<img src="' . JUri::root() . $this->params->get('logoFile') . '" alt="' . $sitename . '" />';}
elseif ($this->params->get('sitetitle')){
	$logo = '<span class="site-title" title="' . $sitename . '">' . htmlspecialchars($this->params->get('sitetitle')) . '</span>';}
else{
	$logo = '<span class="site-title" title="' . $sitename . '">' . $sitename . '</span>';}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <?php
	function IsMobileBrowser(){
	   global $_SERVER;
	   if (isset($_SERVER['HTTP_X_WAP_PROFILE']))return true;
	   if (isset($_SERVER['HTTP_ACCEPT'])){
		  $userAccept = strtolower($_SERVER['HTTP_ACCEPT']);
		  if (!(stristr($userAccept, 'wap')===FALSE))return true;
	   }
	   $userBrowser = strtolower($_SERVER['HTTP_USER_AGENT']);
	   $mobiles = array(
		  "midp", "j2me", "avant", "docomo","novarra", "palmos", "palmsource","240x320", "opwv", "chtml",
		  "pda", "windows ce", "mmp/","blackberry", "mib/", "symbian","wireless", "nokia", "hand", "mobi",
		  "phone", "cdm", "up.b", "audio","SIE-", "SEC-", "samsung", "HTC","mot-", "mitsu", "sagem", "sony", 
		  "alcatel", "lg", "eric", "vx","NEC", "philips", "mmm", "xx","panasonic", "sharp", "wap", "sch","rover", 
		  "pocket", "benq", "java","pt", "pg", "vox", "amoi","bird", "compal", "kg", "voda","sany", "kdd", "dbt", "sendo",
		  "sgh", "gradi", "jb", "dddi","moto", "iphone"
	   );
	   foreach ($mobiles as $value){if (!(stristr($userBrowser, $value)===FALSE)) return true;}
	   return false;
	}
	if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
		if(IsMobileBrowser()){ // neu la mobile chuyen link qua mobile
		?>
			<script src="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>
			<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/protostar/css/mobile.css" type="text/css" />
		<?php
		}
	}
	else{
		?>
			<script src="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>
		<?php
	}
	?>
	<jdoc:include type="head" />
	<?php if ($this->params->get('googleFont')) : ?>
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:bold,300italic,400italic,600italic,400,600,700,300&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
		<style type="text/css">
			h1,h2,h3,h4,h5,h6,.site-title{font-family: '<?php echo str_replace('+', ' ', $this->params->get('googleFontName')); ?>', sans-serif;}
		</style>
	<?php endif; ?>
	<!--[if lt IE 9]>
		<script src="<?php echo $this->baseurl; ?>/media/jui/js/html5.js"></script>
	<![endif]-->
    <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/menu/jquery_002.js"></script>
    <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/croma-app.js"></script>
    <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/cromatheme-app.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/layerslider.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/layerslider_002.js"></script>
    <script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/layerslider_003.js"></script> 
    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.easing.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.carouFredSel.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/protostar/js/greensock.js"></script>
	<link rel="stylesheet" id="layerslider-css" href="<?php echo $this->baseurl; ?>/templates/protostar/css/layerslider.css" type="text/css" media="all">
<script type="text/javascript">
	function autoScroll(){		
		var id = window.location.href.split("#")[1];
		if(id == "aboutus"){
			jQuery("html, body").animate({ scrollTop: (jQuery('#bottombanner').offset().top)-50}, 1000);
		}else if((id == "thucdon") || (id == "menu")){
			jQuery("html, body").animate({ scrollTop: (jQuery('#menufood').offset().top)-50}, 1000);
		}else if((id == "uudai") || (id == "offers")){
			jQuery("html, body").animate({ scrollTop: (jQuery('#specialofweek').offset().top)-50}, 1000);
		}else if((id == "gallery") || (id == "hinhanh")){
			jQuery("html, body").animate({ scrollTop: (jQuery('#gallery').offset().top)-50}, 1000);
		}else if((id == "private-events") || (id == "tiec-rieng")){
			jQuery("html, body").animate({ scrollTop: (jQuery('#topmap').offset().top)-50}, 1000);
		}else if((id == "location") || (id == "vitri")){
			jQuery("html, body").animate({ scrollTop: (jQuery('#map').offset().top)-50}, 1000);
		}
	}
	var i = 0;
	if(i == 0){
		setTimeout(autoScroll,3000);
		i = i + 1;
	}	
	</script>   
<script type="text/javascript">
	function hammenu(idmenu){
		if(idmenu==101){
			jQuery("html, body").animate({ scrollTop: jQuery('#pageheader').offset().top}, 1000);
			jQuery('.menu-item-101').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
		}
		if(idmenu==117){
			jQuery("html, body").animate({ scrollTop: jQuery('#bottombanner').offset().top}, 1000);
			jQuery('.menu-item-117').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
		}
		if(idmenu==108){
			jQuery("html, body").animate({ scrollTop: (jQuery('#menufood').offset().top)-50}, 1000);
			jQuery('.menu-item-108').addClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
		if(idmenu==109){
			jQuery("html, body").animate({ scrollTop: (jQuery('#specialofweek').offset().top)-50}, 1000);
			jQuery('.menu-item-109').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
		if(idmenu==110){
			jQuery("html, body").animate({ scrollTop: (jQuery('#gallery').offset().top)-50}, 1000);
			jQuery('.menu-item-110').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
		if(idmenu==111){
			jQuery("html, body").animate({ scrollTop: (jQuery('#map').offset().top)-50}, 1000);
			jQuery('.menu-item-111').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
		if(idmenu==112){
			jQuery("html, body").animate({ scrollTop: (jQuery('#').offset().top)-50}, 1000);
			jQuery('.menu-item-112').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-113').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
		if(idmenu==113){
			jQuery("html, body").animate({ scrollTop: (jQuery('#topmap').offset().top)-50}, 1000);
			jQuery('.menu-item-113').addClass('menu_active');
			jQuery('.menu-item-108').removeClass('menu_active');
			jQuery('.menu-item-109').removeClass('menu_active');
			jQuery('.menu-item-110').removeClass('menu_active');
			jQuery('.menu-item-111').removeClass('menu_active');
			jQuery('.menu-item-112').removeClass('menu_active');
			jQuery('.menu-item-101').removeClass('menu_active');
			jQuery('.menu-item-117').removeClass('menu_active');
		}
	}
    </script>
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	
	  ga('create', 'UA-57124244-1', 'auto');
	  ga('require', 'displayfeatures');
	  ga('send', 'pageview');
	
	</script>
</head>
<body class="site <?php echo $option.' view-'.$view.($layout?' layout-'.$layout:' no-layout').($task?' task-'.$task:' no-task').($itemid?' itemid-' . $itemid : '').($params->get('fluidContainer')?' fluid':'');
?>">
    <div class="body">
        <jdoc:include type="modules" name="position-menumobile" style="none" />
        <header class="header" id="pageheader">
            <div class="topbar">
                <div class="container">
					<jdoc:include type="modules" name="position-0" style="none" />
				</div>
            </div>
            <div class="topbarlogo">
                <div class="container">
				<?php 
				if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
					if(IsMobileBrowser()){
					?>
                    <jdoc:include type="modules" name="position-1hotline" style="none" />
                    <jdoc:include type="modules" name="position-0book" style="none" />
                    <jdoc:include type="modules" name="position-1" style="none" />
					<?php
					}
					else{
					?>
                    <jdoc:include type="modules" name="position-1hotline" style="none" />
                    <jdoc:include type="modules" name="position-1" style="none" />
                    <jdoc:include type="modules" name="position-0book" style="none" />
					<?php
					}
				}
				else{
				?>
                    <jdoc:include type="modules" name="position-1hotline" style="none" />
                    <jdoc:include type="modules" name="position-1" style="none" />
                    <jdoc:include type="modules" name="position-0book" style="none" />
				<?php
				}
				?>
                </div>
            </div>
            <div class="sticky-wrapper" id="croma-primarynav-sticky-wrapper" style="height:50px;">
                <nav id="croma-primarynav" style="">
                    <div class="mobilemenupart"></div>
                    <div class="croma-primarynav navigation" id="primary-menu">
                        <jdoc:include type="modules" name="position-2" style="none" />
                    </div>
                </nav>
            </div>
        </header>
        <jdoc:include type="modules" name="banner" style="none" />
        <jdoc:include type="modules" name="position-3" style="none" />
        <section id="topmap" class="cro_frontpage_topmap">
            <jdoc:include type="modules" name="position-4" style="none" />
        </section>
        <section id="map" class="cro_frontpage_mapmap">
            <jdoc:include type="modules" name="position-5" style="none" />
			<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?v=3.exp&#038;sensor=false&#038;ver=1.0'></script>
        </section>
        <jdoc:include type="modules" name="position-6" style="wella" />
        
        <footer class="footer" role="contentinfo">
            <div class="container">
                <jdoc:include type="modules" name="position-7" style="wellfooter" />
                <script src="http://www.jscache.com/wejs?wtype=linkingWidgetRedesign&amp;uniq=190&amp;locationId=4209963&amp;lang=en_US&amp;border=true&amp;display_version=2"></script>
            </div>
            <jdoc:include type="modules" name="footer" style="none" />
        </footer>
    </div>
    <div id="background"></div>
	<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>